<template>
  <div class="reportMistakeInfoAction el-card is-always-shadow el-card__body">
<!--    </avue-crud>-->
    <el-dialog title="预览" :visible="dialogVisible" :gutter="24" @close="dialogVisible=false" width="60%">

    <el-table
      :data="tableData"
      :span-method="objectSpanMethod"
      border
      style="width: 100%; margin-top: 20px">
      <el-table-column
        prop="cashBoxType"
        label="钱箱类型">
        <template slot-scope="scope">
          <span>{{scope.row.type}}</span>
        </template>
      </el-table-column>
      <!-- <el-table-column
        prop="cashbox_code"
        label="清点钱箱编号">
      </el-table-column> -->
      <el-table-column
        prop="real_amount"
        label="清点金额">
        <template slot-scope="scope">
          <span>{{numToTwoPoint(scope.row.unload_status=='0'?(scope.row.real_amount):'未卸载')}}</span>
        </template>
      </el-table-column>
      <!-- <el-table-column
        prop="ns_code"
        label="补币钱箱编号">
      </el-table-column> -->
      <el-table-column
        prop="supplementMoney"
        label="补币金额">
        <template slot-scope="scope">
          <span>{{numToTwoPoint(scope.row.ns_amount)}}</span>
        </template>
      </el-table-column>
      <el-table-column
        prop="handOutMoney"
        label="手工清出">
        <template slot-scope="scope">
          <span>{{numToTwoPoint(scope.row.clear_out_amount)}}</span>
        </template>
      </el-table-column>
    </el-table>
<!--    <report-mistake-info-editor ref="reportMistakeInfoEditor" v-if="isShowReportMistakeInfoEditor"></report-mistake-info-editor>-->
    </el-dialog>
  </div>
</template>


<script>
    import {getForm, postForm} from '@/api/gen/gen'
    import ExportJsonExcel from "js-export-excel";
    import moment from 'moment';
    import {
      getgetStationCodes,
      getLineCodes,fenExYuangettoFixed,getMappingStatus,numToTwoPoint
    } from "../../../../api/subwayRat/commonCheck";
    import {
      getXw_tvm_shouJieSuan_preview,
      SRJS_TVM_PREVIEW_OptionList
    } from "../../../../api/stationTiecketManager/shouRuJieSuan/tvm/preview";
    export default {
      components:{
      },
      data() {
            return {
              dialogVisible : false,
              listLoading: true,
              fileTemp:{},
              searchForm:{
                lineCode:"",
                stationCode:''
              },
              tableData:[],
              page: {
                total: 0, // 总页数
                currentPage: 1, // 当前页数
                pageSize: 20, // 每页显示多少条,
                isAsc: false// 是否倒序
              },
              autoWidth: true,
              downloadLoading: false,
              isShowReportMistakeInfoEditor:false,//是否加载编辑页面
              multipleSelectionRows:[],
              multipleSelectionKeys:[],
              lineCodes:[],
              stationCodes:[],
              reportNameIds:[],
              param:{
                lineCode:"",
                stationCode:'',
                reprotTime:"",
                reportNameId:"",
                settleBeginTime:"",
                settleEndTime:""
              },
              option:SRJS_TVM_PREVIEW_OptionList(),
            }
        },
        created() {

        },
        methods: {
          moment,getMappingStatus,fenExYuangettoFixed,numToTwoPoint,
          search(row){
            this.dialogVisible=true;
            // Object.assign(this.searchForm,this.page);
            this.searchForm=row;
            getXw_tvm_shouJieSuan_preview(this.searchForm).then((res)=>{
              this.tableData=res.data.data;
              this.listLoading = false;
              this.page.total=res.data.total;
            });
          },
          handleSelectionChange(val,a){
            this.multipleSelectionRows=val;
            this.multipleSelectionKeys=[];
            for(let i=0;i<this.multipleSelectionRows.length;i++){
              this.multipleSelectionKeys.push(this.multipleSelectionRows[i].id);
            }
          },
          objectSpanMethod({ row, column, rowIndex, columnIndex }) {
            // if (rowIndex==0 && columnIndex === 4) {
            //     return {
            //       rowspan: this.tableData.length,
            //       colspan: 1
            //     };
            // }
          },
          initLine(){
            getLineCodes().then(res=>{ //获取线路
              this.lineCodes=res;
            });
          },
          changeLine(v){
            getgetStationCodes(v).then(res=>{
              this.stationCodes=res;
              this.searchForm.stationCode='';
            })
          },

          selectionChange(list){
            this.multipleSelectionRows=list;
            this.multipleSelectionKeys=[];
            for(let i=0;i<list.length;i++){
              this.multipleSelectionKeys.push(list[i].id);
            }
          },
          handleFilter(params, done) {
            Object.assign(this.searchForm,params);
            this.search()
            done()
          },
        },
      mounted() {

      }
    }
</script>
<style lang="scss">

</style>
